@using Boilerplate.Server.Api.Models.Emailing

@code {
    [Parameter] public ElevatedAccessTokenTemplateModel Model { get; set; } = default!;
    [Parameter] public HttpContext HttpContext { get; set; } = default!;
    [Inject] public IStringLocalizer<EmailStrings> EmailLocalizer { get; set; } = default!;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>@EmailLocalizer[nameof(EmailStrings.ElevatedAccessTokenEmailSubject), Model.Token]</title>
</head>
<body dir="@(CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? "rtl" : null)" style="width:100%; height:100%; margin:0; padding:0; background-color:#FCFCFC; font-family:Arial,sans-serif;">
    <main style="padding: 6% 4%;">
        <table class="content-table" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"
               style="border:1px solid #EDEBE9; border-radius:2px; padding:50px; text-align:center;">
            <tr>
                <td style="color:#0D2960; font-weight:600; font-size:24px; line-height:150%; padding-bottom:50px;">
                    @EmailLocalizer[nameof(EmailStrings.ElevatedAccessTokenHello), Model.DisplayName!]
                </td>
            </tr>
            <tr>
                <td style="font-weight:400; font-size:18px; line-height:155%; padding-bottom:20px;">
                    @EmailLocalizer[nameof(EmailStrings.ElevatedAccessTokenMessage)]
                </td>
            </tr>
            <tr>
                <td align="center" style="padding-bottom:25px;">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="background-color:#0078D4;padding:10px;color:black;font-size:32px;font-weight:bold;">
                                @Model.Token
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="font-weight:400; font-size:18px; line-height:155%;">
                    @EmailLocalizer[nameof(EmailStrings.CopyTokenNote)]
                </td>
            </tr>
        </table>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"
               style="padding:20px; text-align:center;">
            <tr>
                <td style="padding-bottom: 10px;">
                    <img alt="Company Logo" src="@(new Uri(HttpContext.Request.GetWebAppUrl(), "images/icon.png"))" width="30" height="20" />
                </td>
            </tr>
            <tr>
                <td>
                    <a style="text-decoration:none; color:#0065EF; font-weight:400; font-size:12px; line-height:150%;" href="@HttpContext.Request.GetWebAppUrl()">
                        @EmailLocalizer[nameof(EmailStrings.AppName)]
                    </a>
                </td>
            </tr>
        </table>
    </main>
</body>
</html>